<template>
  <div class="content">
    <a-row style="margin-bottom: 20px">
      <a-carousel dotsClass="slick-dots dotsClass" autoplay>
        <div class="img_div">
          <img class="img_carousel" src="static/img/banner.jpg" alt />
        </div>
        <div class="img_div">
          <img class="img_carousel" src="static/img/banner.jpg" alt />
        </div>
        <div class="img_div">
          <img class="img_carousel" src="static/img/banner.jpg" alt />
        </div>
      </a-carousel>
    </a-row>
    <a-row :gutter="36">
      <a-col :xs="{ span: 24 }" :sm="{ span: 9 }">
        <h4>余额</h4>
        <a-card hoverable class="card_sty_top">
          <a-tabs v-model="tabskey" @change="callback">
            <a-tab-pane key="1" tab="现金账户余额">
              <p>
                账户总余额（元）
                <a-icon
                  style="color: black; font-size: 16px"
                  type="sync"
                  @click="getAmount"
                  :spin="syncSpin"
                />
                 <span @click="switchTextBtn">
                  <a-icon :style="{ fontSize: '19px',color:'#7c7b7b',marginLeft:'5px' }" v-if="hideflag=='1'" type="eye-invisible" theme="filled" />
                  <a-icon :style="{ fontSize: '19px',color:'#5d5d5d',marginLeft:'5px' }" v-if="hideflag=='2'" type="eye" /></span>
              </p>
              <a-hide-data
                style="margin-bottom: 20px"
                :params="{
                  type: 'money',
                  value: select.cashAmount,
                  showBtn: false,
                  moneyColor: '#52506b',
                  moneySize: '24px',
                  moneyWeight: '500',
                }"
                :hide="hideflag"
              ></a-hide-data>
              <a-row>
                <a-col :span="12">
                  <p>可提现余额</p>
                  <a-hide-data
                    style="margin-bottom: 30px"
                    :params="{
                      type: 'money',
                      value: select.cashTrueAmount,
                      showBtn: false,
                      moneyColor: '#29a576',
                      moneySize: '18px',
                      moneyWeight: '500',
                    }"
                    :hide="hideflag"
                  ></a-hide-data>
                </a-col>
                <a-col :span="12">
                  <p>已冻结余额</p>
                  <a-hide-data
                    style="margin-bottom: 30px"
                    :params="{
                      type: 'money',
                      value: select.cashFreezeBlanace,
                      showBtn: false,
                      moneyColor: '#f74d39',
                      moneySize: '18px',
                      moneyWeight: '500',
                    }"
                    :hide="hideflag"
                  ></a-hide-data>
                </a-col>
              </a-row>
              <a-row
                type="flex"
                justify="space-between"
                style="margin-bottom: 10px"
              >
                <!--<a-col :span="7">
                      <a-button class="button_sty" :disabled="transOpen" type="primary" @click="Payment()">转账</a-button>
                    </a-col>-->
                  
                <a-col :span="7">
                    <!-- 封装提现按钮 -->
                  <!-- <a-button
                    class="button_sty"
                    v-if="withdraw"
                    type="primary"
                    @click="percashmore()"
                    >提现</a-button
                  > -->
                  <ControlButton buttonText='提现'  v-if="withdraw" buttonType='primary' toolParams='WITHDRAWAL' class="button_sty" @click='percashmore()'/>
                </a-col>
              

                <a-col :span="7">
                  <a-button
                    class="button_sty"
                    v-if="balanceRecharge"
                    type="primary"
                    @click="perRecharge()"
                    >充值</a-button
                  >
                </a-col>
              </a-row>
            </a-tab-pane>

            <a-tab-pane key="2" tab="营销账户余额" force-render>
              <p>
                账户总余额（元）
                <a-icon
                  style="color: black; font-size: 16px"
                  type="sync"
                  @click="getmarketAmount"
                  :spin="syncSpin"
                />
                <span @click="switchTextBtn2">
                  <a-icon :style="{ fontSize: '19px',color:'#7c7b7b',marginLeft:'5px' }" v-if="hideflag2=='1'" type="eye-invisible" theme="filled" />
                  <a-icon :style="{ fontSize: '19px',color:'#5d5d5d',marginLeft:'5px' }" v-if="hideflag2=='2'" type="eye" /></span>
              </p>
              <a-hide-data
                style="margin-bottom: 20px"
                :params="{
                  type: 'money',
                  value: marketDate.marketAmount,
                  showBtn: false,
                  moneyColor: '#52506b',
                  moneySize: '24px',
                  moneyWeight: '500',
                }"
                :hide="hideflag2"
              ></a-hide-data>
              <a-row>
                <a-col :span="12">
                  <p>可提现余额</p>
                  <a-hide-data
                    style="margin-bottom: 30px"
                    :params="{
                      type: 'money',
                      value: marketDate.marketTrueAmount,
                      showBtn: false,
                      moneyColor: '#29a576',
                      moneySize: '18px',
                      moneyWeight: '500',
                    }"
                    :hide="hideflag2"
                  ></a-hide-data>
                </a-col>
              </a-row>
              <a-row
                type="flex"
                justify="space-between"
                style="margin-bottom: 10px"
              >
                <a-col :span="7">
                  <!-- <a-button
                    class="button_sty"
                    v-if="withdraw"
                    type="primary"
                    @click="marketcashmore()"
                    >提现</a-button
                  > -->
                  <ControlButton class="button_sty" buttonText='提现' 
                  toolParams='WITHDRAWAL' 
                  buttonType='primary' 
                  v-if="withdraw"   
                   @click='marketcashmore()'/>
                </a-col>
              </a-row>
            </a-tab-pane>
          </a-tabs>
        </a-card>
      </a-col>
      <a-col :xs="{ span: 24 }" :sm="{ span: 15 }">
        <h4>信息</h4>
        <a-card hoverable class="card_sty_top">
          <!-- <h3>{{merchantName}}<a-button v-if="member.memberType=='BB' && !productionRequest" @click="goProPage"
              :loading='loading1' style="font-size: 12px;height: 28px;padding: 0 5px;margin-left: 15px;" type="primary">
              上线申请
            </a-button>
            
          </h3>-->

          <a-row>
            <a-col :span="12" :style="{ marginBottom: '20px' }">
              <p class="pTitle">合作机构全称</p>
              <h5>{{ select.merchantName }}</h5>
            </a-col>
          </a-row>
          <a-row :gutter="16" style="padding: 5px 0px">
            <a-col :span="12" :style="{ marginBottom: '20px' }">
              <p class="pTitle">会员编号</p>
              <h5>{{ select.memberNo }}</h5>
            </a-col>
            <a-col :span="12" :style="{ marginBottom: '20px' }">
              <p class="pTitle">合作机构号</p>
              <!-- <h5>{{select.merchantNo}}</h5> -->
              <h5>{{ select.username }}</h5>
            </a-col>
            <a-col
              v-if="select.email"
              :span="12"
              :style="{ marginBottom: '0px' }"
            >
              <p class="pTitle">Email</p>
              <h5>
                <a-hide-data
                  :params="{ type: 'email', value: select.email }"
                ></a-hide-data>
              </h5>
            </a-col>
            <a-col :span="12">
              <p class="pTitle">手机号</p>
              <h5>
                <a-hide-data
                  :params="{ type: 'mobileNo', value: select.mobileNo }"
                ></a-hide-data>
              </h5>
            </a-col>
            
            <a-col :span="24" style="margin-top:15px" v-if="member.setInfo">
              <span style="color: blue">防伪信息：{{ member.setInfo }}</span>
            </a-col>

          </a-row>

          <span v-if="alertMessage.id_expire && !alertMessage.id_expire_review">
            <div>
              <a-button type="primary" @click="toModify()">修改</a-button>
              <span style="color: red" v-if="member.transOpen"
                >法人证件有效期即将到期！过期后将无法正常使用账户，请点击修改重新提交！</span
              >
              <span style="color: red" v-if="!member.transOpen"
                >法人证件有效期已过期！请点击修改重新提交！</span
              >
            </div>
          </span>
          <span
            v-if="longUpdatavisible"
            style="color: red; font-size: 12px; margin-left: 15px"
          >
            您已经很久没有修改密码了，为了您的账号安全请定期修改密码。
            <a-button
              @click="gopwd"
              style="font-size: 12px; height: 28px; padding: 0 5px"
              type="primary"
              >修改密码</a-button
            >
          </span>
          <!-- <a-row style="margin-bottom: 10px;margin-top: 10px;">
            <a-button v-if="btnlimits" style="font-size: 13px;" type="primary" @click="goPerModify">修改</a-button>
            <span v-if="customer.status == 'init' " class="statusClass_reviewing">待审核</span>
            <span v-if="customer.status == 'rejected' " class="statusClass_rejected">审核不通过</span>
          </a-row>-->
        </a-card>
      </a-col>
    </a-row>

    <a-row :gutter="36">
      <a-col :xs="{ span: 24 }" :sm="{ span: 9 }">
        <h4>商户交易信息</h4>
        <div class="likeCard">
          <a-row>
            <a-col
              :span="6"
              class="colTitle bdleft bdtop"
              style="border-top-left-radius: 5px"
              >&emsp;&emsp;</a-col
            >
            <a-col :span="8" class="colTitle bdtop">交易笔数</a-col>
            <a-col
              :span="10"
              class="colTitle bdtop"
              style="border-top-right-radius: 5px"
              >交易金额(元)</a-col
            >
            <a-col :span="6" class="colContent bdleft">昨天</a-col>
            <a-col :span="8" class="colContent">{{
              dayTransaction.count
            }}</a-col>
            <a-col :span="10" class="colContent"
              >&#65509;{{ dayTransaction.amount | cashfilter }}</a-col
            >
            <a-col
              :span="6"
              class="colContent bdleft"
              style="border-bottom-left-radius: 5px"
              >当月</a-col
            >
            <a-col :span="8" class="colContent">{{
              monthTransaction.count
            }}</a-col>
            <a-col
              :span="10"
              class="colContent"
              style="border-bottom-right-radius: 5px"
              >&#65509;{{ monthTransaction.amount | cashfilter }}</a-col
            >
          </a-row>
        </div>
      </a-col>
      <a-col :xs="{ span: 24 }" :sm="{ span: 15 }">
        <h4>商户进件信息</h4>
        <a-card hoverable class="card_sty">
          <div class="numberDivClass">
            <div class="numberClass" @click="goOrgAudit">
              <p class="pTitle">待审核</p>
              <span class="numberSpanSize" style="color: #f7b500">{{
                initCount
              }}</span>
            </div>
            <div class="lineRight"></div>
            <div class="numberClass" @click="goOrgAudit">
              <p class="pTitle">初审通过</p>
              <span class="numberSpanSize" style="color: #0070e9">{{
                firstPassCount
              }}</span>
            </div>
            <div class="lineRight"></div>
            <div class="numberClass" @click="goOrgAudit">
              <p class="pTitle">初审不通过</p>
              <span class="numberSpanSize" style="color: #c30d23">{{
                firstRejectedCount
              }}</span>
            </div>
            <div class="lineRight"></div>
            <div class="numberClass" @click="goOrgAudit">
              <p class="pTitle">审核通过</p>
              <span class="numberSpanSize" style="color: #0070e9">{{
                passCount
              }}</span>
            </div>
            <div class="lineRight"></div>
            <div class="numberClass" @click="goOrgAudit">
              <p class="pTitle">审核不通过</p>
              <span class="numberSpanSize" style="color: #c30d23">{{
                rejectedCount
              }}</span>
            </div>
          </div>
        </a-card>
      </a-col>
    </a-row>
    <a-row :gutter="36">
      <a-col :span="24" style="position: relative; height: 280px; width: 100%">
        <div class="chartClass">
          <h5 class="MoneyClass">当月总分润：{{ monthMoney }}元</h5>
          <span>单位(元)</span>
          <div class="chartDiv">
            <v-chart
              :forceFit="true"
              :height="height"
              :padding="padding"
              :data="chartData"
              :scale="scale"
            >
              <v-tooltip />
              <v-axis />
              <v-line position="day*分润金额（元）" />
              <v-point position="day*分润金额（元）" shape="circle" />
            </v-chart>
          </div>
        </div>
      </a-col>
    </a-row>

    <a-modal
      :closable="false"
      v-model="visible"
      :footer="null"
      :maskClosable="false"
      centered
    >
      <div style="height: 150px">
        <span style="font-size: 17px"
          >检测到您的账号为原始密码，为了您的账号安全请修改密码。</span
        >

        <div style="text-align: center; margin-top: 75px">
          <a-button type="primary" @click="toModifypass">去修改</a-button>
        </div>
      </div>
    </a-modal>
  </div>
</template>

<script>
const chartData = [{ day: "1号", "分润金额（元）": 0 }];

const scale = [
  {
    dataKey: "分润金额（元）",
    min: 0,
  },
  {
    dataKey: "day",
    min: 0,
    max: 31,
  },
];
import AHideData from "../common/HideData";
import AccountingDetail from "../common/AccountingDetail";
import ControlButton from "@/components/ControlButton"
import api from "@/common/api";


export default {
  name: "userMain",
  components: {
    AHideData,
    AccountingDetail,
    ControlButton
    
  },
  data() {
    return {
      chartData,
      scale,
      padding: { top: 30, right: 20, bottom: 40, left: 40 },
      height: 220,
      width: 900,
      monthMoney: 0,
      AccountList: [],
      list: {},
      monthTransaction: { count: 0, amount: 0 },
      dayTransaction: { count: 0, amount: 0 },
      firstPassCount: 0,
      initCount: 0,
      firstRejectedCount: 0,
      rejectedCount: 0,
      passCount: 0,
      showAddbank: true,
      syncSpin: false,
      loading1: false,
      loading: false,
      markettabs: false,
      tabskey: "1",
      showAll: "展开",
      showAllBankList: false,
      balanceRecharge: false,
      radioStyle: {
        display: "block",
        height: "30px",
        lineHeight: "30px",
      },
      dotsClass: {
        display: "block",
        height: "30px",
        lineHeight: "30px",
      },
      radiovalue: "",
      isbtn: false,
      customerOrg: {},
      customer: {
        status: "",
      },
      member: {},
      alertMessage: {
        id_expire: null,
        id_expire_review: null,
      },
      spinning: false,
      productionRequest: true,

      select: {
        merchantNo: "11111111111111",
        showName: "暂无",
        merchantName: "暂无",
        loginTime: null,
        memberNo: "暂无",
        username: "暂无",
        mobileNo: "暂无",
        onlinePayAmount: 0,
        onlinePayTrueAmount: 0,
        cashTrueAmount: 0,
        cashAmount: 0,
        cashFreezeBlanace: 0,
        type: null,
      },
      merchantName: "",
      transOpen: null,
      recharge: null,
      withdraw: null,
      perstatus: "",
      btnlimits: false,
      paypassword: "",
      pawList: [],
      bankList: [],
      secondBankList: [],
      currentDate: "",
      memberType: this.$store.state.memberType,
      visible: false,
      longUpdatavisible: false,
      userType: "",
      marketDate: {
        marketAmount: 0,
        marketTrueAmount: 0,
        isNextStep: false,
      },
      hideflag:'1',
      hideflag2:'1',
    };
  },

  created() {
   
    let date = new Date();
    let currentMonth;
    if (date.getMonth() + 1 < 10) {
      currentMonth = "0" + (date.getMonth() + 1);
    } else {
      currentMonth = date.getMonth() + 1;
    }
    this.currentDate =
      date.getFullYear().toString() + currentMonth + "" + date.getDate();
  },
  mounted() {
    this.$emit("changelogintime", "", true, "");
    // this.getOrginfo();
  },
  activated() {
    this.getOrginfo();
    this.getChart();
    this.getmarketAmount();
    // this.getTransactionList()
  },
  filters: {
    cashfilter(value) {
      return parseFloat(value / 100).toFixed(2);
    },
  },
  methods: {
    callback(key) {
      console.log(key);
      if (this.markettabs == false) {
        this.$message.info("当前账户未开通营销商户！");
        this.tabskey = "1";
      }
    },
    toModify() {
      if (this.select.type == "CU") {
        this.$router.push({
          path: "/per/accountmanage/myinfo",
        });
      } else {
        this.$router.push({
          path: "/org/accountmanage/myinfo",
        });
      }
    },
    getChart() {
      this.$axios.get("/agent/homePage/getChart").then((res) => {
        if (res.data.code == "OK") {
          let countOfMonth = res.data.data.countOfMonth;
          // let countOfMonth = [1,654,11,558,1188,1,654,11,558,1188,1,654,11,558,1188,1,654,11,558,1188,1,654,11,558,1188,1,654,11,558,1188,654]
          // let countOfMonth = [0,0,0,1,5,0]
          this.monthMoney = res.data.data.amount;
          this.chartData = [];
          let mouth = new Date().getMonth() + 1;
          // console.log("mouth",mouth)
          countOfMonth.forEach((item, index) => {
            this.chartData.push({
              day: mouth + "/" + (index + 1),
              "分润金额（元）": item == 0 ? 0 : parseFloat(item).toFixed(2),
            });
          });
        }
      });
    },
    onChange(e) {
      // console.log("radio checked", e, e.target.value);
    },
    goOrgAudit() {
      this.$router.push("/OrgRegister/orgAuditQuery");
    },
    showAllbank() {
      this.showAllBankList = !this.showAllBankList;
      this.showAll = !this.showAllBankList ? "展开" : "折起";
    },
    switchTextBtn() {
      if (this.hideflag == '1') {
        this.hideflag = '2'
      } else if (this.hideflag == '2') {
        this.hideflag = '1'
      }
    },
    switchTextBtn2() {
      if (this.hideflag2 == '1') {
        this.hideflag2 = '2'
      } else if (this.hideflag2 == '2') {
        this.hideflag2 = '1'
      }
    },
    myinform(type) {
      if (
        this.customerOrg.status == "pass" &&
        this.customerOrg.statusName == "审核通过"
      ) {
        if (type == 1) {
          this.$router.push("/org/accountmanage/myinfo");
        }
        if (type == 2) {
          this.$router.push("/org/transmanage/ratequery");
        }
        if (type == 3) {
          this.$router.push("/org/transmanage/quotaquery");
        }
        if (type == 4) {
          this.$router.push("/org/financemanage");
        }
      } else {
        this.$message.warning(this.customerOrg.statusName);
      }
    },
    getOrginfo() {
      this.$axios.get("/agent/homePage/main").then((res) => {
        // console.log(res);

        if (res.data.code == "OK") {
          this.spinning = false;
          this.getInfo();
          // this.downloadItem();
          // this.getInfo1();
          //商户交易信息
          this.dayTransaction = res.data.data.day;
          this.monthTransaction = res.data.data.month;
          //商户进件信息
          this.firstPassCount = res.data.data.firstPassCount;
          this.initCount = res.data.data.initCount;
          this.firstRejectedCount = res.data.data.firstRejectedCount;
          this.rejectedCount = res.data.data.rejectedCount;
          this.passCount = res.data.data.passCount;
          // if (res.data.data.products.recharge == true) {
          //   this.recharge = false;
          // } else {
          //   this.recharge = true;
          // }
          // if (res.data.data.products.transfer == true) {
          //   this.transOpen = false;
          // } else {
          //   this.transOpen = true;
          // }
          if (res.data.data.products.withdraw == true) {
            this.withdraw = true;
          } else {
            this.withdraw = false;
          }
          if (res.data.data.products.balanceRecharge == true) {
            this.balanceRecharge = true;
          } else {
            this.balanceRecharge = false;
          }
          if (res.data.data.productionRequest) {
            this.productionRequest = true;
          } else {
            this.productionRequest = false;
          }
          this.member = res.data.data.member;
          if (res.data.data.member.alertMessage) {
            this.alertMessage = JSON.parse(res.data.data.member.alertMessage);
          }
          //修改密码提示
          if (res.data.data.isFirstLogin == true) {
            this.visible = true;
          } else {
            this.visible = false;
          }
          if (res.data.data.isUpdateLoginPassword == false) {
            this.longUpdatavisible = true;
          } else {
            this.longUpdatavisible = false;
          }
          // this.select.memberNo = res.data.data.member.memberNo;
          // this.select.showName = res.data.data.member.showName;
          // this.select.username = res.data.data.member.username;
          // this.select.mobileNo = res.data.data.member.mobileNo;
          // this.select.loginTime = res.data.data.member.loginTime;
          this.select = res.data.data.member;
          // this.merchantName = res.data.data.pospMerchant.merchantName;
          this.$emit(
            "changelogintime",
            this.select.loginTime,
            false,
            this.select.merchantName,
            sessionStorage.getItem("count")
          );
          this.select.type = res.data.data.member.memberType;

          // console.log(res.data.data.member.memberType);
          sessionStorage.setItem("shortName", this.select.showName);
          sessionStorage.setItem("username", this.select.merchantName);
          sessionStorage.setItem("payPassword", this.select.payPassword);
          this.$store.dispatch("changeType", "BB");

          localStorage.setItem("memberType", this.select.type);
          localStorage.setItem("setInfo", res.data.data.member.setInfo);
          // sessionStorage.setItem("userName", this.merchantName);
          // localStorage.setItem(
          //   "merchantType",
          //   res.data.data.pospMerchant.merchantType
          // );
          this.select.username = res.data.data.member.username;
          this.select.mobileNo = res.data.data.member.mobileNo;
          this.select.onlinePayAmount = res.data.data.onlinePayAmount
            ? parseFloat(res.data.data.onlinePayAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.select.onlinePayTrueAmount = res.data.data.onlinePayTrueAmount
            ? parseFloat(res.data.data.onlinePayTrueAmount / 100).toFixed(2) +
              "元"
            : 0.0 + "元";
          this.select.cashTrueAmount = res.data.data.cashTrueAmount
            ? parseFloat(res.data.data.cashTrueAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.select.cashAmount = res.data.data.cashAmount
            ? parseFloat(res.data.data.cashAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.select.cashFreezeBlanace = res.data.data.cashFreezeBlanace
            ? parseFloat(res.data.data.cashFreezeBlanace / 100).toFixed(2) +
              "元"
            : 0.0 + "元";
        } else {
          this.$message.info(res.data.message)
        }
      });
    },
    goProPage() {
      this.$axios
        .get("/agent/production/get/" + this.select.merchantNo)
        .then((res) => {
          if (res.data.code == "OK") {
            if (res.data.message == "没有数据") {
              this.$router.push({
                path: "/org/ProductionRequest",
                query: {
                  production: {
                    merchantNo: this.select.merchantNo,
                    merchantName: this.merchantName,
                    presentation: "",
                    message: "",
                    whiteListDTOList: [],
                    remark: "",
                    statusName: "",
                  },
                },
              });
            } else {
              this.$router.push({
                path: "/org/ProductionRequest",
                query: { modify: res.data.data },
              });
            }
          } else {
            if (res.data.message == "审核已通过") {
              this.$message.info("已通过审核");
            } else {
              this.$router.push("/org/Production/succ");
              // this.$message.info('审核中')
            }
          }
        });
    },
    doNext(step) {
      var st = step + 1;
      this.$router.push("/OrgRegister/step" + st);
    },
    percashmore() {
      // console.log("提现");
      this.$router.push({ path: "/perCashOut" });
    },
    marketcashmore() {
      // console.log("营销账户提现");
      if (this.marketDate.isNextStep) {
        this.$router.push({ path: "/marketCashOut" });
      } else {
        // this.$router.push({ path: "/marketCashOut" });
        this.$message.info(
          "营销账户存在欠款，无法提现，您可将现金账户余额提现至营销账户来补足欠款"
        );
      }
    },
    //个人客户修改
    goPerModify() {
      this.$router.push({
        path: "/PersonRegister/step4",
        query: { modify: true },
      });
    },

    perRecharge() {
      // let memberType = this.$store.state.memberType; //CB 单位客户 CU 个人客户 BB特约商户 CBO企业客户 CBM个体工商
      // if (memberType == "CU") {
      //   this.$router.push({ path: "/perRecharge" });
      // } else if (memberType == "CBM") {
      //   this.getquickpay();
      //   // this.$router.push({ path: "/perRecharge" });
      // } else if (memberType == "CBO" || memberType == "BB") {
      //   this.$router.push({ path: "/orgRecharge" });
      // }
      this.$router.push({ path: "/orgRecharge" });
    },
    Payment() {
      this.$router.push("/allPayment");
    },
    getquickpay() {
      this.$axios
        .get("/agent/recharge/select/UnitCustomer/bankCardInfo")
        .then((res) => {
          // console.log(res);
          // console.log(res.data.data.bankCardDTO.accountNo);
          if (res.data.code == "OK") {
            if (res.data.data.bankCardDTO.externalNo == null) {
              this.$message.warning("您还未开通快捷支付");
              this.$router.push({
                name: "开通快捷支付",
                params: {
                  bankCardDTOdata: res.data.data.bankCardDTO,
                },
              });
            } else {
              this.$router.push({ path: "/perRecharge" });
            }
          } else {
            this.$message.warning(res.data.message);
          }
        });
    },
    getInfo() {
      let userName = localStorage.getItem("userName");
      if (userName) {
        this.userName = userName;
      }
      let data = {
        username: this.userName,
      };
      api.getUserInfo(
        data,
        (res) => {
        
          if (res.code == "OK") {
            let mobileNo = res.data.mobileNo;
            let securityQuestion = res.data.securityQuestion;
            let userName = res.data.userName;
            let memberNo = res.data.memberNo;
            let email = res.data.email;
            localStorage.setItem("mobileNo", mobileNo);
            localStorage.setItem("securityQuestion", securityQuestion);
            localStorage.setItem("userName", userName);
            localStorage.setItem("memberNo", memberNo);
            localStorage.setItem("payemail", email);
          } else {
            this.$message.error(res.message);
          }
        },
        (err) => {}
      );
    },
    getInfo1() {
      let userName = localStorage.getItem("userName");
      if (userName) {
        this.userName = userName;
      }
      let data = {
        username: this.userName,
      };
      api.getUserInfo1(
        data,
        (res) => {
          
          if (res.code == "OK") {
            let mobileNo = res.data.mobileNo;
            let securityQuestion = res.data.securityQuestion;
            let userName = res.data.userName;
            let memberNo = res.data.memberNo;
            let email = res.data.email;
            localStorage.setItem("mobileNo", mobileNo);
            localStorage.setItem("securityQuestion", securityQuestion);
            localStorage.setItem("userName", userName);
            localStorage.setItem("memberNo", memberNo);
            localStorage.setItem("payemail", email);
          } else {
            this.$message.error(res.message);
          }
        },
        (err) => {}
      );
    },
    // 下载单个文件
    downloadItem() {
      // this.$axios.get(`/transaction/checkUrlById/${id}`).then(res => {
      //   if (res.data.code == 'OK') {
      const a = document.createElement("a");
      a.download = "这是测试.xls"; //下载历史记录查询的文件名
      // let token = localStorage.getItem("token");
      let downloadUrl =
        `/agent/transaction/getUrlById/1584942606870021?Authorization=` +
        "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1ODU3Mjg5NDcsInVzZXJuYW1lIjoiNDA4NDUwNzNAcXEuY29teCJ9.HBAZIzEYm384wkeYrej1IaGqgrkthkcscRT_YVDWy5Y";
      a.href = downloadUrl;
      document.body.appendChild(a);
      a.click();
      document.body.removeChild(a);
      //   } else {
      //     this.$message.warning(res.data.message)
      //     return
      //   }
      // }, err => {

      // })
    },
    getTransactionList() {
      let data = {
        transCode: "all",
        transDate: this.currentDate,
        // transDate:  '20190926' ,
        current: 1,
        pageSize: 3,
      };
      api.transactionList(
        data,
        (res) => {
          // console.log(res);
          if ((res.code = "OK")) {
            this.AccountList = res.list;
          }
        },
        (err) => {
          console.log(err);
        }
      );
    },
    toModifypass() {
      this.visible = false;
      // this.$router.push(`/setpassword`);
      this.$router.push({
        name: "首次设置密码",
        params: {
          memberNo: this.select.memberNo,
        },
      });
    },

    getAmount() {
      this.syncSpin = true;
      this.$axios.get("/agent/homePage/getBalance").then((res) => {
        if (res.data.code == "OK") {
          this.syncSpin = false;

          this.select.onlinePayAmount = res.data.data.onlinePayAmount
            ? parseFloat(res.data.data.onlinePayAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.select.onlinePayTrueAmount = res.data.data.onlinePayTrueAmount
            ? parseFloat(res.data.data.onlinePayTrueAmount / 100).toFixed(2) +
              "元"
            : 0.0 + "元";
          this.select.cashTrueAmount = res.data.data.cashTrueAmount
            ? parseFloat(res.data.data.cashTrueAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.select.cashAmount = res.data.data.cashAmount
            ? parseFloat(res.data.data.cashAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.select.cashFreezeBlanace = res.data.data.cashFreezeBlanace
            ? parseFloat(res.data.data.cashFreezeBlanace / 100).toFixed(2) +
              "元"
            : 0.0 + "元";
        } else {
          this.syncSpin = false;
          // this.$message.error("获取更新数据失败");
        }
      });
    },
    getmarketAmount() {
      this.syncSpin = true;
      this.$axios.get("/agent/withdraw/market/getBalance").then((res) => {
        if (res.data.code == "OK") {
          this.syncSpin = false;

          this.marketDate.marketAmount = res.data.data.marketAmount
            ? parseFloat(res.data.data.marketAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.marketDate.marketTrueAmount = res.data.data.marketTrueAmount
            ? parseFloat(res.data.data.marketTrueAmount / 100).toFixed(2) + "元"
            : 0.0 + "元";
          this.marketDate.isNextStep = res.data.data.isNextStep;
          this.markettabs = true;
        } else {
          this.syncSpin = false;
          this.markettabs = false;
          // this.$message.error(res.data.message);
        }
      });
    },
    gopwd() {
      if (this.memberType == "CU") {
        this.userType = "per";
      } else {
        this.userType = "org";
      }
      this.$router.push(`/${this.userType}/safeset/modifyloginpw`);
    },
  },
};
</script>
<style scoped>
* {
  padding: 0;
  margin: 0;
}

.content {
  /* overflow: scroll; */
  background: #e4e8ed;
  height: 100%;
  /* overflow-y: auto; */
  /* overflow-x: hidden; */
  width: 100%;
  margin-top: -20px;
}

p {
  color: #aaa;
}

h5 {
  font-size: 18px;
  color: #52506b;
}

h4 {
  color: #98989e;
  font-size: 22px;
  margin-bottom: 15px;
  margin-left: 10px;
}

h3 {
  font-size: 24px;
  color: #52506b;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.ant-btn-primary {
  padding-right: 20px;
  padding-left: 20px;
}

.card_sty {
  border-radius: 5px;
  background-color: #fff;
  border: 1px solid #fff;
  height: 160px;
  /* flex: 1; */
  text-align: left;
  margin-bottom: 20px;
}

.card_sty_top {
  border-radius: 5px;
  background-color: #fff;
  border: 1px solid #fff;
  /* height: 160px; */
  /* flex: 1; */
  text-align: left;
  margin-bottom: 20px;
}

.button_sty {
  width: 100%;
}

.span_btn {
  border-radius: 5px;
  padding: 5px 10px;
  color: #156ec1;
  background: rgba(225, 239, 255, 0.8);
  margin-right: 20px;
}

.span_ctime {
  font-size: 16px;
  color: #52506b;
}

.input_group {
  width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item_input {
  width: 50px;
  height: 50px;
  padding: 15px 5px;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
}

.statusClass_rejected {
  color: red;
  font-size: 20px;
  margin-left: 20px;
  height: 27px;
  display: inline-block;
}

.statusClass_reviewing {
  color: orange;
  font-size: 20px;
  margin-left: 20px;
  height: 27px;
  display: inline-block;
}

.radio_card {
  height: 700px;
}

.li_radio_style {
  list-style: none;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  width: 50%;
}

.li_radio_style img {
  width: 30px;
  height: 30px;
  vertical-align: middle;
  margin: 0 1%;
}

.li_radio_style span {
  color: #b3292c;
  margin-left: 40%;
}

.addBank {
  border: 1px solid #bbb;
  border-radius: 5px;
  text-align: center;
  padding: 5px 10px;
  width: 50%;
}

/* 轮播图 */
.ant-carousel >>> .slick-slide {
  text-align: center;
  /* height: 11vh; */
  /* line-height: 11vh; */
  overflow: hidden;
}

.ant-carousel >>> .slick-slide h3 {
  color: #fff;
}

.dotsClass {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #fff;
}

.dotsClass li {
  list-style: none;
}

/* .img_div {
    background: url('../../../static/img/banner.jpg') no-repeat;
    background-size: 100% 100%;
    height: 11vh;
  } */

.img_carousel {
  width: 100%;
  /* height: 100%; */
  /* height:auto; */
  /* max-width:100%; */
}

/*滚动条样式*/
.content::-webkit-scrollbar {
  /*滚动条整体样式*/
  width: 4px;
  /*高宽分别对应横竖滚动条的尺寸*/
  height: 4px;
}

.content::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  border-radius: 5px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.content::-webkit-scrollbar-track {
  /*滚动条里面轨道*/
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.1);
}

.Incoming span {
  padding: 5px 10px;
}

.IncomingClass {
  margin-left: 6px;
}

.numberClass {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 112px;
}

.numberDivClass {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-direction: row;
}

.numberSpanSize {
  font-size: 19px;
}

.lineRight {
  border-right-width: 1px;
  border-right-style: solid;
  border-right-color: #d8d8d8;
  height: 60px;
}

.likeCard {
  border-radius: 5px;
  background: #fff;
  /* border: 1px solid #fff; */
  /* padding: 1px; */
}

.colTitle {
  border: 1px solid #d8d8d8;
  background: #fafafa;
  border-bottom: none;
  border-right: none;
  padding: 15px 10px;
  text-align: center;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.85);
}

.colContent {
  border: 1px solid #d8d8d8;
  background: #fff;
  border-bottom: none;
  border-right: none;
  padding: 16px 10px;
  text-align: center;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
}

.bdleft {
  border-left: none;
}

.bdtop {
  /* border-top: none; */
  border-top-color: #fff;
}

.bd {
  border-top-right-radius: 4px;
  border-bottom-left-radius: 4px;
  border-top-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.deep/.ant-table-thead
  > tr.ant-table-row-hover:not(.ant-table-expanded-row)
  > td,
.ant-table-tbody > tr.ant-table-row-hover:not(.ant-table-expanded-row) > td,
.ant-table-thead > tr:hover:not(.ant-table-expanded-row) > td,
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
  background: #fff;
}

.chartClass {
  background-color: #fff;
  padding: 25px 20px 0 30px;
  /* position: absolute;
    bottom: -30px; */
  /* width: 100%; */
  /* width: 80vw; */
  border-radius: 5px;
}

.chartClass .MoneyClass {
  font-size: 18px;
  color: #000000;
  margin-bottom: 10px;
  /* margin-left: 15px; */
}

.chartDiv {
  /* position: absolute;
    top: 0px;
    right: 0px; */
  width: 100%;
}

@media only screen and (max-width: 1920px) {
  .chartClass {
    width: 1554px;
  }
}

@media only screen and (max-width: 1330px) {
  .chartClass {
    width: 1030px;
  }
}
</style>